import pygame
import sys
from pygame.locals import *


POINT_UP=1
POINT_DOWN=2
POINT_RIGHT=3
POINT_LEFT=4

class Point:
    x = None
    y = None
    dir = None
    
    def move_down(self, distance ):
        self.y = self.y + distance
    
    def move_up(self, distance):
        self.y = self.y - distance
        
    def move_right(self, distance):
        self.x = self.x + distance
        
    def move_left(self, distance):
        self.x = self.x - distance
        
        
    def move(self, distance):
        if ( self.dir == POINT_UP ):
            self.move_up(distance)
        if ( self.dir == POINT_DOWN ):
            self.move_down(distance)
        if ( self.dir == POINT_RIGHT):
            self.move_right(distance)
        if ( self.dir == POINT_LEFT):
            self.move_left(distance)
    
    
 
pygame.init()
pygame.display.set_caption('Paint')
# screen = pygame.display.set_mode( (800,400), pygame.FULLSCREEN )
screen = pygame.display.set_mode( (800,400) )
screen.fill((125,0,125))


''' temporary '''
p = Point()
p.y = 10
p.x = 10
p.dir = POINT_DOWN

def refresh( my_point ):
    pygame.draw.lines( screen, (255,255,255), False, [(0,0),(0,10),(10,10),(my_point.x, my_point.y )] )
    pygame.display.update()

while True:
    for event in pygame.event.get():
        if event.type == KEYDOWN:
            if event.key == K_ESCAPE:
                sys.exit()
            if event.key == K_UP:
                p.dir = POINT_UP
        ''' amit - do all rest ''' 
                
#        p.y = p.y + 1
    p.move(1)
    refresh( p )
        
        
        
        
 
            
   
        
